import request from '@/utils/request'

/**
 * 书籍列表
 * @param {Object} params 
 */
export function querybookPage(params) {
  return request({
    url: '/system/book/list',
    method: 'get',
    params: params
  })
}


/**
 * 书籍导出
 * @param {String} id 
 */
export function bookExport(data) {
  return request({
    url: '/system/book/export',
    method: 'post',
    data: data
  })
}


/**
 * 书籍详情
 * @param {String} id 
 */
export function queryBookDetail(id) {
  return request({
    url: '/system/book/'+id,
    method: 'get'
  })
}

/**
 * 新增书籍
 * @param {Object} data 
 */
export function addBook(data) {
  return request({
    url: '/system/book',
    method: 'post',
    data: data
  })
}


/**
 * 编辑书籍
 * @param {Object} data 
 */
export function editBook(data) {
  return request({
    url: '/system/book',
    method: 'put',
    data: data
  })
}


/**
 * 删除书籍
 * @param {String} ids 
 */
export function deleteBook(ids) {
  return request({
    url: '/system/book/'+ids,
    method: 'delete',
  })
}


/**
 * 批量隐藏书籍
 * @param {String} ids 
 */
export function hideBook(ids) {
    return request({
      url: '/system/book/hideBooks/'+ids,
      method: 'put',
    })
  }

  /**
 * 批量显示书籍
 * @param {String} ids 
 */
export function showBook(ids) {
  return request({
    url: '/system/book/showBooks/'+ids,
    method: 'put',
  })
}